Make CSV column headers case insensitive#110
Merged
dmendelowitz merged 2 commits intodevelopfrom Apr 26, 2021
Merged
Conversation
jafeltra
reviewed
Apr 22, 2021
Contributor
There was a problem hiding this comment.
This looks great! The changes are really minimal given that you had to change so much! I had a few small things inline and then I had a few other thoughts:
- It looks like this line in CSVObservationExtractor.test.js should also be updated if you agree with the other similar comments.
- It might be good to test that the CSV Validator can successfully validate headers that are in various casing that doesn't match the schema. I think that should cover the changes in
csvValidator.jsandCSVModule.js. - I think we'll need a small PR in the E-MEF because the ClinicalTrialExtractor there uses the CSV Module, so when we update the MEF, I think it will be looking for the lower case changes.
Contributor
Author
|
Okay, I think I fixed the comments mentioned here, so give that another look. I also created a PR on the E-MEF (https://gitlab.mitre.org/mcode/epic-mcode-extraction-framework/-/merge_requests/128) for the Epic Clinical Trial Information extractor there that also uses CSVs |
jafeltra
approved these changes
Apr 26, 2021
Contributor
jafeltra
left a comment
There was a problem hiding this comment.
This looks great! Thanks for making those changes!
Contributor
|
I think this just needs a rebase to get back in line with |
3debca4 to
ca71c5e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Column headers of CSV files read as input for the MEF can now have any casing and will still be treated the same by the program
New behavior
The program should still run the same as before, but now CSV headers can have any casing (e.g.
enrollmentStatus,ENROLLMENTSTATUS, andEnRoLlMeNtStAtUsare all valid and refer to the same thing).Code changes
csvModule.jsnow converts all headers to lowercase upon reading the CSV and will convert any keys provided to a get function to lowercase to properly find valuescsvValidoator.jshas been updated to convert the CSV schema and actual CSV headers to lowercase before comparing themTesting guidance